package com.kommii.test;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

public class test2 {

	public static String toStringHex(String s) {
		byte[] baKeyword = new byte[s.length() / 2];
		for (int i = 0; i < baKeyword.length; i++) {
			try {
				baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(
						i * 2, i * 2 + 2), 16));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		try {
			s = new String(baKeyword, "utf-8");// UTF-16le:Not
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		return s;
	} 
	
	public static String toHexString(String s) {
		String str = "";
		for (int i = 0; i < s.length(); i++) {
			int ch = (int) s.charAt(i);
			String s4 = Integer.toHexString(ch);
			str = str + s4;
		}
		return str;
	} 
	public static void main(String[] args) {
		String str = "abc.jsp";
		String s = "abc.jsp/www.jsp/tt.jsp!ww=w";
		//boolean t = str.contains(s);
		//boolean tt = s.contains(str);
		String[] arr = s.split("/", 6);
		System.out.println(arr.length);
		System.out.println(arr[0]);
		System.out.println(arr[1]);
		DBObject entity = new BasicDBObject();
		System.out.println(entity.get("_id"));
	}

}
